<?php

class sms{
	function __construct()
    {
        $this->sms();
    }
	function sms()
    {
    }
	/**
     * 检测手机号码是否正确
     *
     */
    function is_moblie($moblie)
    {
       return  preg_match("/^0?1((3|8)[0-9]|5[0-35-9]|4[57])\d{8}$/", $moblie);
    }

	function send($mobile,$content){
		if(empty($msg)){
			return false;
		}else if(!empty($msg)){
				/*$url = "http://http.asp.sh.cn/MT.do?Username=youhi&Password=123456&Mobile=".$phone."&Content=".$msg."&Keyword=";
				$cu = curl_init();
				curl_setopt($cu, CURLOPT_URL, $url);
				curl_setopt($cu, CURLOPT_RETURNTRANSFER, 1);
				$ret = curl_exec($cu);
				curl_close($cu);
				if($ret==0){
					return true;
				}else{
					return false;
				}*/
			//功能：发送短信
			$id = "IS001-1806";
			$username = "yueguo";
			$password  = "111111";
			//$mobile  = "13816064684";
			//$content= "悦国红酒【悦国红酒】";
			$fp = fopen("http://211.155.25.162:8080/?CORPID=$id&username=$username&password=$password&mobile=$mobile&content=$content","r");
			$ret= fgetss($fp,255);
			fclose($fp);
			//echo $ret."<br>";
			$str_list = explode(':',$ret);
			if($str_list[0]==1){
				return true;
			}else{
				return false;
			}
		}
	}
}


//$sms = new sms();
//echo $sms->send('13816064684','你好，我们的红酒已经送达！！！');

   
?>